package com.iespring.controller.admin.configmanager;

import com.iespring.bean.admin.configmanager.bo.ConfigOrderBo;
import com.iespring.bean.admin.configmanager.bo.ConfigWxBo;
import com.iespring.bean.common.BaseRespVo;
import com.iespring.service.admin.configmanager.ConfigManagerService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * \* Auth: 杨宇健
 * \* Time: 2022/12/31 11:21
 * \* Description:
 * \
 */
@RestController
@RequestMapping("admin/config")
public class ConfigManagerController {
    @Resource
    ConfigManagerService configManagerService;
    @PostMapping("order")
    public BaseRespVo orderConfig(@RequestBody @Valid ConfigOrderBo configBo){
        BaseRespVo respVo = configManagerService.update(configBo);
        return respVo;
    }

    @GetMapping("order")
    public BaseRespVo orderConfig(){
        BaseRespVo respVo = configManagerService.selectOrder();
        return respVo;
    }

    @GetMapping("wx")
    public BaseRespVo wx(){
        BaseRespVo respVo = configManagerService.wx();
        return respVo;
    }
    @PostMapping("wx")
    public BaseRespVo wx(@RequestBody @Valid ConfigWxBo config){
        BaseRespVo respVo = configManagerService.update(config);
        return respVo;
    }
}
